<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>我的电脑(lite)</title>
<style>
body { font-size:14px; margin:10px; font-family:Arial, Helvetica, sans-serif; }
div, span, ul, li, h1, h2, h3{ overflow:hidden; margin:0; padding:0; }
a { color:#0000FF; }
a:active { color:#FF6600; }
body { word-spacing:10px; font-size:18px; line-height:30px; }
</style>

</head>
<body>


<?php

$link_tree = '';
foreach ($data as $id => $item) {
	// 是链接还是文字
	$link_tree .= $item['info']['url'] != '' ? "<a href=\"./?m=link&a=goto&item_id=$id&url=".base64_encode($item['info']['url'])."\">{$item['info']['title']}</a>" : $item['info']['title'];
	// 子链接
	if(!empty($item['data'])) {
		$child_arr = array();
		foreach ($item['data'] as $id => $child) {
			$child_arr[] = "<a href=\"./?m=link&a=goto&item_id=$id&url=".base64_encode($child['url'])."\">{$child['title']}</a>";
		}
		$link_tree .= '['.implode(',', $child_arr).']';
	}
	// 链接空隙
	$link_tree .= ' ';
}

echo $link_tree;
?>

</body>
</html>